// import { request } from './request'
import { apiUrl } from './api'
import axiosRequest from './httpRequest'
// 首页数据
export const getHomeData = () => {
  return axiosRequest.request({
    url: apiUrl.getHomeData
  })
}
// 特色专区
export const getHomeSpecialZone = () => {
  return axiosRequest.request({
    url: apiUrl.getHomeSpecialZone
  })
}
// Category 左边列表页面数据
export const getCategoryData = () => {
  return axiosRequest.request({
    url: apiUrl.getCategoryData
  })
}
// Category 右边内容页面数据 需要根据左边点击传值
export const getCategoryDetailData = params => {
  return axiosRequest.request({
    url: apiUrl.getCategoryDetailData + params
  })
}
// 购物车模块，猜你喜欢
export const getGuessYouLike = () => {
  return axiosRequest.request({
    url: apiUrl.getGuessYouLike
  })
}
// 登录界面接口
// 1.获取手机验证码(GET)
// Easy Mock 模拟发送验证码
export const getPhoneCaptcha = phoneNumber => {
  return axiosRequest.request({
    url: apiUrl.getPhoneCaptcha,
    params: {
      phoneNumber
    }
  })
}
// 2.手机验证码登录(POST)
// Easy Mock 模拟用户登录
export const phoneCaptchaLogin = (phone, captcha) => {
  return axiosRequest.request({
    method: 'POST',
    url: 'login_code',
    data: {
      phone,
      captcha
    }
  })
}

// 3.账号密码登录(POST)
export const pwdLogin = (userName, pwd, captcha) => {
  return axiosRequest.request({
    methods: 'POST',
    url: apiUrl.pwdLogin,
    data: {
      userName,
      pwd,
      captcha
    }
  })
}

// 个人中心
// 1.绿卡Vip
export const getVipContent = () => {
  return axiosRequest.request({
    url: apiUrl.getVipContent
  })
}
